import request from '@/utils/request'

 //API常量
 const APIS = {
  V1: "/v1"
}

export function createBorrower(data) {
  return request({
    url: APIS.V1+`/system/client/saveBorrower`,
    method: 'post',
    data
  })
}

export function createBorrowerDraft(data) {
  return request({
    url: APIS.V1+`/system/client/saveBorrowerDraft`,
    method: 'post',
    data
  })
}

export function updateBorrower(data) {
  return request({
    url: APIS.V1+`/system/client/updateBorrower`,
    method: 'post',
    data
  })
}

export function batchSaveOwnerBorrower(data) {
  return request({
    url: APIS.V1+`/system/client/batchSaveOwnerBorrower`,
    method: 'post',
    data
  })
}

export function batchSaveOwnerBorrowerDraft(data) {
  return request({
    url: APIS.V1+`/system/client/batchSveOwnerBorrowerDraft`,
    method: 'post',
    data
  })
}

export function batchUpdateOwnerBorrower(data) {
  return request({
    url: APIS.V1+`/system/client/batchUpdateOwnerBorrower`,
    method: 'post',
    data
  })
}

export function getByIdCardNo(idCardNo) {
  return request({
    url: APIS.V1+`/system/client/findByIdCardNo`,
    method: 'get',
    params: idCardNo
  })
}

export function findByProjectId(projectId) {
  return request({
    url: APIS.V1+`/system/client/findByProjectId`,
    method: 'get',
    params: projectId
  })
}

export function findListByProjectId(projectId) {
  return request({
    url: APIS.V1+`/system/client/findListByProjectId`,
    method: 'get',
    params: projectId
  })
}


export function listPayeeByClientId(borrowerId) {
  return request({
    url: APIS.V1+`/system/client/listPayeeByClientId`,
    method: 'get',
    params: borrowerId
  })
}


export function findRejectRecordByCardNo(idCardNo) {
  return request({
    url: APIS.V1+`/system/client/findProjectRejectRecordByIdCardNo`,
    method: 'get',
    params: idCardNo
  })
}


export function deleteOwner(param) {
  return request({
    url: APIS.V1+`/system/client/deleteOwner`,
    method: 'get',
    params: param
  })
}

export function confirmCapital(data) {
  return request({
    url: APIS.V1 + `/system/project/confirm/capital`,
    method: 'post',
    params: data
  })
}
export function exportInfo(data) {
  return request({
    url: APIS.V1 + `/system/client/export`,
    method: 'get',
    params: data
  })
}


